//
//  TabBarViewController.swift
//  QNN
//
//  Created by zhenyu on 17/3/30.
//  Copyright © 2017年 qianshengqian. All rights reserved.
//

import UIKit

class TabBarController: UITabBarController {
  
  override func viewDidLoad() {
    super.viewDidLoad()
    tabBar.isTranslucent = true
//    tabBar.shadowImage = #imageLiteral(resourceName: "white")
    tabBar.tintColor = Color.theme
    // Do any additional setup after loading the view.
    setViewControllers()
  }
  
  override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
  }
  
  
  // MAKR: - SetViewController
  func setViewControllers() {
    let home = NavigationController(rootViewController: HomeViewController())
    home.tabBarItem.image = #imageLiteral(resourceName: "t_home").withRenderingMode(.alwaysOriginal)
    home.tabBarItem.selectedImage = #imageLiteral(resourceName: "t_home_selected").withRenderingMode(.alwaysOriginal)
    home.title = "首页"
    
    let message = NavigationController(rootViewController: MessageViewController())
    message.tabBarItem.image = #imageLiteral(resourceName: "t_message").withRenderingMode(.alwaysOriginal)
    message.tabBarItem.selectedImage = #imageLiteral(resourceName: "t_message_selected").withRenderingMode(.alwaysOriginal)
    message.title = "消息列表"

    let attention = NavigationController(rootViewController: AttentionViewController())
    attention.tabBarItem.image = #imageLiteral(resourceName: "t_attention").withRenderingMode(.alwaysOriginal)
    attention.tabBarItem.selectedImage = #imageLiteral(resourceName: "t_attention_selected").withRenderingMode(.alwaysOriginal)
    attention.title = "关注"

    let mine = NavigationController(rootViewController: MineViewController())
    mine.tabBarItem.image = #imageLiteral(resourceName: "t_mine").withRenderingMode(.alwaysOriginal)
    mine.tabBarItem.selectedImage = #imageLiteral(resourceName: "t_mine_selected").withRenderingMode(.alwaysOriginal)
    mine.title = "我"
    
    viewControllers = [home,message,attention,mine]
  }
}
